var app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    id: '',
    type: 0,
    phone: '',
    info: {},
    status: '',
    goodList: [
    ],
    singleTotalMoney: ''
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      is_zi_cai:options.is_zi_cai,
      id: options.id,
      order_status: 7,
    });
    this.loadList(options.id);

  },
  loadList: function (id) {
    var that = this;
    app.AppHttp('api/Orders/orderDetail', { id: id, order_status: 7 }, function (res) {
      let goodList1 = [];
      let goodList = res.data.detail.goodList;
      for (let i in goodList) {
        goodList1.push(goodList[i])
      }
      that.setData({
        info: res.data.detail,
        goodList: goodList1,
        status: res.data.status,
        singleTotalMoney: parseFloat(res.data.detail.singleTotalMoney).toFixed(2),
        singlePriceTotal: parseFloat(res.data.detail.singlePriceTotal).toFixed(2)
      });
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  }
})